<?php
namespace app\admin\model;
use think\Model;

class Banner extends Model
{
	protected $autoWriteTimestamp = true;

	public function getNormalBanner()
	{
		$where = [
			'status' => 1,
		];
		$order = [
			'listorder' => 'desc',
			'id' => 'desc',
		];
		return $this->where($where)->order($order)->select();
	}

	public function getBanners()
	{
		$where = [
			'status' => ['neq',-1],
		];
		$order = [
			'listorder' => 'desc',
			'id' => 'desc',
		];
		return $this->where($where)->order($order)->paginate(4);
	}
}
